package com.securitytrace.util;

import java.util.List;
import java.util.Vector;

import com.securitytrace.model.Address;


public class AddressConvertToVector extends ConvertAdapter<Address> {

	public  Vector<?> convertToVector(List<Address> addresses) {
		if(addresses == null || addresses.size()<1) {
			return null;
		}
		Vector<Vector<?>> vectors = new Vector<Vector<?>>();
		for(Address address : addresses) {
			if(convertToVector(address)== null) {
				return null;
			}
			vectors.add(convertToVector(address));
		}
		return vectors;
	}

	public Vector<?> convertToVector(Address address) {
		if(address == null) {
			return null;
		}
		Vector<String> vector = new Vector<String>();
		vector.add(address.getAddressName());
		vector.add(address.getOtherInfo());
		return vector;
	}

}
